package com.xinchuang.initializrdemo.utils;

public class R {
    private Integer code;
    private String msg;
    private Object data;

    public static R ok() {
        R r = new R();
        r.setCode(200);
        return r;
    }

    public static R error(String msg) {
        R r = new R();
        r.setCode(400);
        r.setMsg(msg);
        return r;
    }

    public static R data(Object data) {
        R r = new R();
        r.setCode(200);
        r.setData(data);
        return r;
    }

    public static R ok(String msg) {
        R r = new R();
        r.setCode(200);
        r.setMsg(msg);
        return r;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public Object getData() {
        return data;
    }
}
